/**
 * This assumes the user is logged in and renders their profile picture,
 * name and a logout link.
 */
/**
 * This assumes the user is logged in and renders their profile picture,
 * name and a logout link.
 */
function friendsList(){  
  
	FB.api('/me/friends', { fields: 'name,id,location,birthday' }, function(result) {
		document.getElementById('result').innerHTML =
		require('jsDump').parse(result)
	})
}

/**
 * This assumes the user is logged out, and renders a login button.
 */
function showLoginButton() {
  document.getElementById('account-info').innerHTML = (
    '<img onclick="FB.login()" style="cursor: pointer;"' +
         'src="https://s-static.ak.fbcdn.net/rsrc.php/zB6N8/hash/4li2k73z.gif">'
  );
}

/**
 * This will be called once on page load, and every time the status changes.
 */
function onStatus(response) {
  Log.info('onStatus', response);
  if (response.status === 'connected') {
    showAccountInfo();
  } else {
    showLoginButton();
  }
}
FB.getLoginStatus(function(response) {
  onStatus(response); // once on page load
  FB.Event.subscribe('auth.statusChange', onStatus); // every status change
});

